/*
* Copyright (C) Microsoft. All rights reserved.  
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not 
* use this file except in compliance with the License.  You may obtain a copy 
* of the License at http://www.apache.org/licenses/LICENSE-2.0  
* 
* THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 
* WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 
* MERCHANTABLITY OR NON-INFRINGEMENT. 
*
* See the Apache License, Version 2.0 for specific language governing 
* permissions and limitations under the License.
*
*/
#pragma once
#include <journal/app/constants.h>
#include <journal/models/interfaces.h>
#include <journal/models/internal_interfaces.h>
#include <baja/stream/storage_file_interface.h>

namespace journal { namespace model {

namespace b = baja;
namespace s = baja::storage;
namespace bt = baja::transition_tracking;

enum photo_model_transition_type
{
    readyEventTransition,
    notReadyEventTransition,
    updateTransition,
};

class photo_model_transition :
    public bt::itransition_parameters
{
public:
    struct model_state
    {
        std::shared_ptr<s::istorage_file> localStorageFile;
        std::shared_ptr<b::imemory_stream> localStorageFileStream;
        b::uint32 mediaFileId;
        b::float32 scale;
        m::point2d position;
        b::float32 angle;
        b::Boolean active;

        model_state() :
            mediaFileId(0),
            scale(0.0f),
            position(0.0f, 0.0f),
            angle(0.0f),
            active(true)
        {
        }
    };

    model_state _state0;
    model_state _state1;

public:
    photo_model_transition();

    b::uint32 transitionType(void);

    void dump();
};

}} // namespace journal::model